﻿<Window x:Class="TciNewsReader_2014_04.Controls.ErrorReport"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:TciNewsReader_2014_04.Controls"
        xmlns:infrastructure="clr-namespace:TciNewsReader_2014_04.Infrastructure"
        xmlns:customControls="clr-namespace:CustomControls;assembly=CustomControls"
        Title="{x:Static infrastructure:Constants.ApplicationTitle}" 
        WindowStartupLocation="CenterScreen" Icon="/TciNewsReader-2014-04;component/Resources/Images/Identity/tyburn-geoOrb.png" 
        ShowInTaskbar="False" Topmost="True" SnapsToDevicePixels="True" ResizeMode="NoResize" WindowStyle="ToolWindow"
        >
    <Grid Background="Transparent">
        <DockPanel>
            <DockPanel DockPanel.Dock="Bottom" HorizontalAlignment="Stretch">
                <DockPanel.Resources>
                    <Style TargetType="Button">
                        <Setter Property="Width" Value="100"/>
                    </Style>
                </DockPanel.Resources>
                <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                    <Button Content="Ok" HorizontalAlignment="Right" CommandParameter="true" Command="{Binding ErrorReportDoneCommand}"/>
                    <customControls:InterItemGap/>
                </StackPanel>
            </DockPanel>
            <DockPanel DockPanel.Dock="Bottom" Background="Navy">
                <Grid DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="10">
                    <Grid.Resources>
                        <Style TargetType="TextBlock">
                            <Setter Property="TextWrapping" Value="Wrap"/>
                            <Setter Property="Foreground" Value="Wheat"/>
                        </Style>
                    </Grid.Resources>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition MaxWidth="300"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Grid.Row="0" Text="This panel lists data errors in the feeds.  They can be corrected by the feed provider."/>
                </Grid>
            </DockPanel>
            <customControls:TextBlockPanelHeader DockPanel.Dock="Top" Text="Exceptions/Errors Encountered During Feed Retrieval" />
            <DataGrid 
                DockPanel.Dock="Top"
                ItemsSource="{Binding ExceptionInfos}" 
                IsReadOnly="False"
                CanUserAddRows="False"
                CanUserDeleteRows="False"
                CanUserSortColumns="True"
                AutoGenerateColumns="False"
                Background="{StaticResource CustomGradientGreenEmber}"
                >
                <DataGrid.RowStyle>
                    <Style TargetType="DataGridRow">
                        <Setter Property="Background" Value="Transparent" />
                        <Setter Property="Foreground" Value="Wheat"/>
                        <Setter Property="FontWeight" Value="Bold"/>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="Navy"/>
                                <Setter Property="Foreground" Value="White"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.RowStyle>
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Error Source" Binding="{Binding Culprit}" IsReadOnly="True"/>
                    <DataGridTextColumn Header="Message" Binding="{Binding Message}" IsReadOnly="True"/>
                </DataGrid.Columns>
            </DataGrid>
        </DockPanel>
    </Grid>
</Window>
